<?php

namespace app\api\validate;

use think\Validate;

class Message extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'name'    => 'require',
        'mobile'  => 'require|integer',
        'content' => 'require',

    ];
    /**
     * 提示消息
     */
    protected $message = [
        'name.require'    => '請輸入聯絡人',
        'mobile.require'  => '請輸入手機號碼',
        'mobile.integer'  => '手機號碼僅限數字',
        'content.require' => '請填寫留言信息',
        // 'code.number'  =>   '编码必须是数字',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'do'   => ['name', 'mobile', 'content'],
        'edit' => [],
    ];

}
